﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSem3.Admin
{
    public partial class WebForm8 : System.Web.UI.Page
    {
        private DataClassesHeaxlthDataContext dc = new DataClassesHeaxlthDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Artical at = new Artical();
                at = this.dc.Articals.Single(a => a.categoryID.Equals(3));
                this.CKEditor1.Text = at.content;
            } 
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string content = this.CKEditor1.Text;
            updatehome(content);
            this.Labelkq.Text = "Update Successful";


        }
        public void updatehome(string content)
        {
            Artical atc = this.dc.Articals.Single(c => c.articalID.Equals(3));
            atc.content = content;
            dc.SubmitChanges();
        }
    }
}